package com.wjp.banquet.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum BanquetIsSealEnum {

    YES(true,"已封存"),

    NO(false,"未封存"),

    ;

    private boolean code;

    private String msg;

    /**
     * 根据code返回msg
     * @param code
     * @return
     */
    public static String getNameByCode(boolean code){
        BanquetIsSealEnum[] enums = BanquetIsSealEnum.values();
        for(int i = 0; i < enums.length; i++){
            BanquetIsSealEnum anEnum = enums[i];
            if(anEnum.isCode() == (code)){
                return anEnum.getMsg();
            }
        }
        return null;
    }
}
